Skip to content

feat: show deletion provenance on report badge#48

Merged
NotThatKindOfDrLiz merged 2 commits intomainfrom
feat/deletion-provenance
Apr 8, 2026
Merged

feat: show deletion provenance on report badge#48
NotThatKindOfDrLiz merged 2 commits intomainfrom
feat/deletion-provenance

Conversation

@mbradley
Copy link
Copy Markdown
Member

@mbradley mbradley commented Apr 7, 2026

Summary

  • The "Event Deleted" badge in report detail now distinguishes between "Removed by Moderation" (we did it) and "Not Found on Relay" (unknown cause).
  • Tooltip on hover provides context: moderation deletion date, auto-hidden status, user ban, or "may have been self-deleted by the author."
  • Uses existing useDecisionLog data — no new API calls or backend changes.

Surfaced by Aleysha's Apr 2 report batch — a deleted event with no indication of who removed it or why.

Test plan

  • Deploy to staging, find a report where the event was deleted by moderation — confirm badge says "Removed by Moderation" with date tooltip
  • Find a report where the event is gone but no decision exists — confirm badge says "Not Found on Relay" with self-deletion tooltip
  • Find a report where user is banned — confirm tooltip mentions ban
  • Existing tests: 71 pass, tsc clean

When a reported event is gone from the relay, the badge now indicates
why: 'Removed by Moderation' (with date tooltip) when our decision log
has a delete action, 'Not Found on Relay' otherwise. Tooltip provides
additional context for auto-hidden, user-banned, or unknown cases
(likely author self-deletion).
@mbradley mbradley force-pushed the feat/deletion-provenance branch from ae075d4 to 77763b4 Compare April 7, 2026 21:09
- Auto-hidden tooltip now checks !isAutoHideRestored to avoid claiming
  a causal link when the auto-hide was already reversed
- Added isEventBanned branch for events banned via NIP-86 without a
  corresponding D1 decision record (previously fell through to 'Not Found')
- Badge labels now cover: Removed by Moderation, Auto-Hidden, User Banned,
  Event Banned, Not Found on Relay
- Added staleTime (30s) to useDecisionLog to prevent refetch on every
  report navigation (CLAUDE.md compliance)
@mbradley
Copy link
Copy Markdown
Member Author

mbradley commented Apr 8, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@mbradley mbradley marked this pull request as ready for review April 8, 2026 20:33
@NotThatKindOfDrLiz
Copy link
Copy Markdown
Member

Non-blocking: the tooltip content currently runs the same .find() twice for the delete decision lookup. It works, but if you touch this again I’d collapse that into a local variable for readability.

Copy link
Copy Markdown
Member

@NotThatKindOfDrLiz NotThatKindOfDrLiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. The provenance split is useful, the priority order is reasonable, and reusing existing decision-log data keeps the change nicely scoped.

@NotThatKindOfDrLiz NotThatKindOfDrLiz merged commit 3d13313 into main Apr 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants